<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 调用栈就是函数的一个调用链
        // 容易出错和麻烦
        function baz() {
            // baz
            console.log('baz');
            bar()
        }
        function bar() {
            // baz --> bar
            console.log('bar');
            foo()
        }
        function foo() {
            // baz --> bar --> foo
            console.log('foo');
        }
        baz()
    </script>
</body>

</html>